﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EntityFrameworks.Data.Core;

namespace Common.Background.Controllers
{
    public class CommonController : BaseController
    {
        //
        // GET: /Common/

        /// <summary>
        /// 部门单选框
        /// </summary>
        /// <returns></returns>
        public ActionResult PartialDepartment()
        {
            return View(base.DeptRepository
                            .GetModel()
                            .ToList());
        }
        /// <summary>
        /// 角色复选框
        /// </summary>
        /// <param name="deptID"></param>
        /// <returns></returns>
        public ActionResult PartialRole(int deptID)
        {
            return View(base.RoleRepository
                            .GetModel()
                            .Where(i => i.DepartmentID == deptID)
                            .ToList());
        }
        /// <summary>
        /// 部门——角色视图
        /// </summary>
        /// <returns></returns>
        public ActionResult PartialDept_Role()
        {
            return View();
        }

    }
}
